<%@ page language="java"  pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>数据采集</title>
     
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>js/jquery/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>js/jquery/themes/icon.css">
		<script type="text/javascript" src="<%=basePath%>js/jquery/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="<%=basePath%>js/jquery/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="<%=basePath%>js/jquery/locale/easyui-lang-zh_CN.js"></script>
 		<script type="text/javascript" src="<%=basePath%>js/ztree/js/jquery.ztree.core-3.5.js"></script>
 		<script type="text/javascript" src="<%=basePath%>js/ztree/js/jquery.ztree.excheck-3.5.js"></script>
 	    <link rel="stylesheet" href="<%=basePath%>js/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
		<script type="text/javascript">
			function showMap(lat,lng){
				return "<a style='cursor: pointer;' onclick = \"open1("+lat+","+lng+")\" >查看位置</a>";
			}
			function open1(lat,lng){
				window.open("mapResult.jsp?lat="+lat+"&lng="+lng);
			}
			$(document).ready(function (){
			initGrid();
			});
			function initGrid(){
				$('#dataGrid').datagrid({
				url:"<%=basePath %>dataCollection/getDataCollectionList.xhtml",
				pageSize:20,
				title:"数据采集管理",
				iconCls:'icon-save',
				pagination:true,
				striped:true,
				loadMsg:"加载中...",
				fit:true,
				rownumbers:true,
				collapsible:true,
				singleSelect:true,
				toolbar:"#tb",
				columns:[[
					{field:"time",title:"采集时间",width:"150"},
					{field:"address",title:"拍照地址",width:"150"},
					{field:"txt",title:"拍照说明",width:"150"},
					
					{field:"truename",title:"数据采集人员",width:"150"},
					{field:"tel",title:"联系电话",width:"150"},
					{field:"lat",title:"查看上报位置",width:"150",formatter:function (d,t){
						return showMap(t.lat,t.lng);
					}},
					{field:"photoimg",title:"采集信息图片",width:"150",formatter:function (image,t){
					return "<a style='cursor: pointer;' onclick = \"window.open('imageShow.jsp?imgname="+image+"')\"><img style = 'width:150px;height:80px;' src = '<%=basePath%>sys/user/userAction!getImage.action?imgname="+image+"' /></a>";
					}}
				]]
			});	
			}
		</script>
  </head>
  <body class="easyui-layout" >
  	<div region="center"   >
		<table id = "dataGrid"  ></table>
		</div>
		<div id = "tb" >
			采集人员:<input type = "text" id = "cjUser" />
			采集时间范围<input type = "text" id = "cjstime" class = "easyui-datetimebox"  />-<input id = "cjetime"  type = "text" class = "easyui-datetimebox" />
			<button onclick = "searchForm()" >查询</button>
			<button onclick = "clearForm()" >清空</button>
		</div>
		<script type="text/javascript">
			function clearForm(){
				$('#cjstime').datebox('setValue','');
				$('#cjetime').datebox('setValue','');
				$('#cjUser').val('');
			}
			function searchForm(){
				var queryParams = $('#dataGrid').datagrid('options').queryParams;
				var stime = $('#cjstime').datebox('getValue');
				var etime = $('#cjetime').datebox('getValue');
				var user = $('#cjUser').val();
				queryParams.stime = stime ;
				queryParams.etime = etime ;
				queryParams.user = user ;
				$('#dataGrid').datagrid('options').queryParams = queryParams;
				$('#dataGrid').datagrid('reload');
			}
		</script>
  </body>
  
</html>
